Column

Presented are the results of the FMG online teaching survey, conducted by the FMG Teaching & Learning Centre.

Responses

491

Teaching tips

90

Schools

Column

What is one online teaching tip or trick that you would share with fellow teachers?

Column

Word cloud

---
title: "FMG-TLC online teaching survey report"
output: 
  flexdashboard::flex_dashboard:
    orientation: columns
    vertical_layout: fill
    theme: default
    css: "style.css"
    source_code: embed
    # df_print: tibble
---

```{r setup, include=FALSE}
library(flexdashboard)

library("readxl")
survey_results <- read_excel("../../data/FMG teachers 2 minute survey  December 2020_January 15, 2021_09.45.xlsx", skip = 1)
```


Column {data-width=300}
-----------------------

Presented are the results of the FMG online teaching survey, conducted by the FMG Teaching & Learning Centre.

### Responses

```{r}
n.responses <- dim(survey_results)[1]
valueBox(n.responses, icon = "fa-pencil", color = "#E89300")
```

### Teaching tips

```{r}
n.tips <- sum(!is.na(survey_results$`What is one online teaching tip or trick that you would share with fellow teachers?`))
valueBox(90, icon = "fa-comments", color = "#E89300")
```

### Schools

```{r}
schools <- survey_results$`In which school(s) do you teach?`

# Some teachers belong to multiple schools
schools <- strsplit(schools, ",")

schools <- unlist(schools)

as.data.frame(table(schools)) -> schools.freq
```


```{r, eval=T}
# install.packages("plotly")
# install.packages("ggplot2")
library(plotly)

ax <- list(
  title = "",
  zeroline       = FALSE,
  showline       = FALSE,
  showticklabels = FALSE,
  showgrid       = FALSE
)

schools.freq %>%  
  plot_ly(x      = ~schools, 
          y      = ~Freq, 
          type   = "bar", 
          colors = "viridis",
          marker = list(color = "#E89300")
          # autoexpand  = F
          # orientation = "h"
          )  %>% layout(xaxis = ax, yaxis = ax, margin = list(l = 10,
                                                              b = 10,
                                                              autoexpand = F))
```


Column {data-width=650}
-----------------------------------------------------------------------

### `r names(survey_results)[6]`

```{r, echo=FALSE, message=FALSE, warning=FALSE}
library(DT)

willing.to.share <- grep("Yes", survey_results$`Would you be willing share this with us in a one-minute video or as part of a TLC newsletter column?`)

DT::datatable(survey_results[willing.to.share,6],
              rownames = FALSE,
              colnames = "",
              options  = list(bPaginate = FALSE)
              )

# survey_results[willing.to.share,6]
```


Column {data-width=350}
-----------------------------------------------------------------------

### Word cloud

```{r, eval=TRUE}
# Used resource: https://towardsdatascience.com/create-a-word-cloud-with-r-bde3e7422e8a

# Set seed for same wordcloud after recompiling
set.seed(4536)

# install.packages("RColorBrewer")
library(RColorBrewer)
# install.packages("wordcloud2")
library("wordcloud2")
# install.packages("tm")
library(tm)
library("dplyr")

# Create a vector containing only the text
text <- survey_results$`What is one online teaching tip or trick that you would share with fellow teachers?`

docs <- Corpus(VectorSource(text))

# Clean the text

docs <- docs %>%
  tm_map(removeNumbers) %>%
  tm_map(removePunctuation) %>%
  tm_map(stripWhitespace)
docs <- tm_map(docs, content_transformer(tolower))
docs <- tm_map(docs, removeWords, stopwords("english"))

# Create word frequencies

dtm <- TermDocumentMatrix(docs) 
matrix <- as.matrix(dtm) 
words <- sort(rowSums(matrix),decreasing=TRUE) 
df <- data.frame(word = names(words),freq=words)

# Create word cloud

wordcloud2(data=df, size=1, color='random-dark')
```



### Next